/* 头部导航样式 */

#header {
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

#header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
}

.logo {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.logo a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.logo a:hover {
    color: var(--primary-color);
}

/* 导航菜单 */
.nav {
    display: flex;
    align-items: center;
}

.nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav li {
    margin-left: var(--spacing-xl);
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-size-base);
    font-weight: 500;
    padding: var(--spacing-sm) 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav a:hover,
.nav a.active {
    color: var(--primary-color);
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: var(--border-radius-full);
}

.nav a:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: var(--border-radius-full);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-normal);
}

.nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* 移动端菜单按钮 */
.mobile-menu {
    display: none;
}

#menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    position: relative;
    width: 30px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#menu-toggle span {
    display: block;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: var(--border-radius-full);
    transition: all var(--transition-normal);
}

#menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

#menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 响应式设计 */

/* 平板设备 */
@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 250px;
        background-color: var(--card-background);
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        transition: right var(--transition-normal);
        padding: var(--spacing-xl) 0;
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav ul {
        flex-direction: column;
        width: 100%;
    }
    
    .nav li {
        margin: 0;
    }
    
    .nav a {
        display: block;
        padding: var(--spacing-md) var(--spacing-xl);
        color: var(--text-primary);
    }
    
    .nav a.active {
        background-color: rgba(52, 152, 219, 0.1);
        color: var(--primary-color);
    }
    
    .nav a::after {
        display: none;
    }
    
    .mobile-menu {
        display: block;
    }
}

/* 移动设备 */
@media (max-width: 480px) {
    #header .container {
        padding: var(--spacing-sm) 0;
    }
    
    .logo {
        font-size: var(--font-size-lg);
    }
    
    .nav {
        width: 100%;
    }
}